ihelpuoo.namespace("ihelpuoo.widget.error");

ihelpuoo.widget.error.ErrorItemView = function(gasket)
{
	this.view = new ihelpuoo.widget.View(gasket,ihelpuoo.widget.error.itemPattern);
	this.oErrorIcon = null;
	this.oWarnIcon = null;
	this.oText = null;
}

ihelpuoo.widget.error.ErrorItemView.prototype
=
{
	draw : function(e)
	{
		if(this.view.isNeverBeDrawn())
		{
			this.view.preparePattern();
			this.oErrorIcon = this.view.getElement("errorIcon");
			this.oWarnIcon = this.view.getElement("warnIcon");
			this.oText = this.view.getElement("text");
		}
		this.view.display();
		if(null!=e)
		{
			ihelpuoo.dom.autoSetObject(this.oText,e.message);
			if(e.isError())
			{
				this.oErrorIcon.style.display = "inline";
				this.oWarnIcon.style.display = "none";
			}
			else
			{
				this.oErrorIcon.style.display = "none";
				this.oWarnIcon.style.display = "inline";
			}
		}		
	}
}